#pragma once

#include <memory>
#include <Eigen/Eigen>
#include <opencv2/opencv.hpp>
#include "render/Objects/Renderer3DObject.h"

namespace pwp {
class Renderer3DView;
class ImageRender;
}

class TinyRender {
public:
	TinyRender();
	~TinyRender();

	void Render(pwp::Renderer3DObject& object, const Eigen::Transform<float, 3, Eigen::Affine>& pa, cv::Mat* mask, cv::Mat* depth);
	void Render(pwp::Renderer3DObject& object, const float* pa, cv::Mat* mask, cv::Mat* depth);

	bool CalcBodyPoint(
		const cv::Point2f& center, 
		const Eigen::Transform<float, 3, Eigen::Affine>& camera2body_pose,
		Eigen::Vector3f* center_f_body);

	bool CalcBodyPoint(
		int x, int y,
		const Eigen::Transform<float, 3, Eigen::Affine>& camera2body_pose,
		Eigen::Vector3f* pt_body);

	int width() { return width_; }
	int height() { return height_; }

	pwp::Renderer3DView* render_view_;
	pwp::ImageRender* render_images_;
	int width_, height_;
};

